package action.vo;

public class ZoneTreeNode extends TreeNode{
	private boolean ifOrgn;
	
	private String code;

	
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getCls() {
		return super.getCls();
	}	
	public String getIconCls() {
		return super.getIconCls() == null || "".equals(super.getIconCls()) ? (ifOrgn ? "admin-tool-orgn" : "admin-tool-zone" ) : super.getIconCls();
	}
	
	
	/**
	 * zone -> treeNode
	 * @param id treeNodeId 因为orgn和zone混排，需要统一一个ID号码
	 * @param text
	 * @param cls
	 * @param iconCls
	 * @param expanded
	 * @param leaf
	 * @param mid 对象ID
	 * @param ifOrgn 
	 * @param zoneId
	 * @param parentId orgn.parent.id 或者 zone.parent.id
	 */
	public ZoneTreeNode(String text, String cls, String iconCls, boolean expanded, boolean leaf, 
			Integer mid, boolean ifOrgn,
			Long zoneId, Long parentId) {
		
		super((ifOrgn ? "O_"+mid : "Z_"+mid), text, cls, iconCls, expanded, leaf);
		
		super.setMid(mid);
		this.ifOrgn = ifOrgn;
		this.zoneId = zoneId;
		this.parentId = parentId;
	}
	
	public boolean isIfOrgn() {
		return ifOrgn;
	}
	public void setIfOrgn(boolean ifOrgn) {
		this.ifOrgn = ifOrgn;
	}
	
	//当前节点的zone信息，在 ifOrgn=true 时有用
	private Long zoneId;
	
	//当前节点的parentId
	private Long parentId;
	public Long getZoneId() {
		return zoneId;
	}
	public void setZoneId(Long zoneId) {
		this.zoneId = zoneId;
	}
	public Long getParentId() {
		return parentId;
	}
	public void setParentId(Long parentId) {
		this.parentId = parentId;
	}
	

}
